Always set an error when returning NULL. (453365, Michael Chudobiak)
authorMatthias Clasen <mclasen@redhat.com>
Tue, 3 Jul 2007 18:22:22 +0000 (18:22 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 3 Jul 2007 18:22:22 +0000 (18:22 +0000)
2007-07-03  Matthias Clasen  <mclasen@redhat.com>

        * io-tiff.c (tiff_image_parse): Always set an error
        when returning NULL.  (453365, Michael Chudobiak)

svn path=/trunk/; revision=18365

gdk-pixbuf/ChangeLog
gdk-pixbuf/io-tiff.c

index 66f0d40da85006d9f79350d90c94240717f71cd0..10bec09fc0ebe46802b962b91053420211b35d89 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-03  Matthias Clasen  <mclasen@redhat.com>
+
+       * io-tiff.c (tiff_image_parse): Always set an error
+       when returning NULL.  (453365, Michael Chudobiak)
+
 2007-07-03  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Be
index a9863e6cffb2fd8eb2a36c8896170e63fa51d3f6..9e521022dcd723dd8cfdc3189f41edee19883b15 100644 (file)
@@ -199,8 +199,13 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
                 gint h = height;
                (* context->size_func) (&w, &h, context->user_data);
                 
-                if (w == 0 || h == 0)
+                if (w == 0 || h == 0) {
+                    g_set_error (error,
+                                 GDK_PIXBUF_ERROR,
+                                 GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+                                 _("Width or height of TIFF image is zero"));
                     return NULL;
+                }
         }
 
         pixels = g_try_malloc (bytes);